# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-configparser
_pkgname=configparser
pkgver=4.0.2
pkgrel=3
pkgdesc='Updated configparser from Python 3.7 for Python 2.6+.'
url='https://pypi.org/project/configparser/#files'
arch=('any')
license=('MIT')
depends=('python2' 'python2-backports')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6213348bbaf28432d0f43fed614aaf1005669366c5c29473c6ed5d8de89cf2e06aa42afc6aba8bd44b915203c1828d2fe1d8bbb6d9d6bd1c17638a5bdf79504d')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  rm "$pkgdir/usr/lib/python2.7/site-packages/backports/__init__.py"{,c,o}
}

